<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>

        <p:growl id="growl" globalOnly="false" showDetail="true" life="6000" />
        <ui:include src="#{webContext.skinPatch}statusDialog.xhtml" />
        <p:dialog id="dialog" width="320" header="#{ml.tr('Login')}" 
                  widgetVar="dlgLogin" modal="true">
            <h:form>
                #{loginBean.setLoginUrl(man.requestUrl)}
                <h:panelGrid columns="2" cellpadding="5">
                    <h:outputLabel for="username" value="#{ml.tr('Username')}: " />
                    <p:inputText value="#{loginBean.user.username}"
                                 id="username" required="true" label="username" 
                                 requiredMessage="#{ml.tr('Username is required')}"/>
                    <h:outputLabel for="password" value="#{ml.tr('Password')}: " />
                    <h:inputSecret value="#{loginBean.user.passwd}"
                                   id="password" required="true" label="password"
                                   requiredMessage="#{ml.tr('Password is required')}"
                                   styleClass="ui-inputfield ui-widget ui-state-default ui-corner-all"/>

                    <f:facet name="footer">
                        <p:commandButton value="#{ml.tr('Login')}" 
                                         update="growl"
                                         actionListener="#{loginBean.login}"
                                         onclick="statusDialog.show()"
                                         oncomplete="statusDialog.hide()"/>
                    </f:facet>
                </h:panelGrid>
            </h:form>
        </p:dialog>
    </h:body>
</html>

